package com.data.modules.online.cgform.enhance.impl.http;

import com.alibaba.fastjson.JSONObject;
import com.data.common.util.ConvertUtils;
import com.data.modules.online.cgform.enhance.impl.http.base.CgformEnhanceHttpInter;
import com.data.modules.online.cgform.entity.OnlCgformEnhanceJava;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component("cgformEnhanceJavaHttpImpl")
public class CgformEnhanceHttpFormImpl implements CgformEnhanceHttpInter {

    private static final Logger f136a = LoggerFactory.getLogger(CgformEnhanceHttpFormImpl.class);

    @Override
    public int execute(String tableName, JSONObject json, OnlCgformEnhanceJava enhance) {
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("tableName", tableName);
        jSONObject.put("json", json);
        Object sendPost = sendPost(jSONObject, enhance);
        if (sendPost != null) {
            return ConvertUtils.getInt(sendPost).intValue();
        }
        return 1;
    }
}
